#
# This file is a part of the open-eBackup project.
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, You can obtain one at
# http://mozilla.org/MPL/2.0/.
#
# Copyright (c) [2024] Huawei Technologies Co.,Ltd.
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
#

class SapConst:
    BACKUP_PARAM_FILE = "saphana_backup_{}_opbackint_param.txt"
    RECOVERY_PARAM_FILE = "saphana_recovery_{}_opbackint_param.txt"
    SAPHANA_DATABASE = "SAPHANA-database"
    SAPHANA_INSTANCE = "SAPHANA-instance"
    SINGLE = "single"
    SAPHANA_PARAM_PATH = "/usr/sap/"
    BACKINT_CONFIG_SUFFIX = "SYS/global/hdb/opt/hdbconfig/backint.conf"
    DEFAULT_LOGBACKUP_PATH_SUFFIX = "backup/log"
    ENABLE_LOG_CMD = "alter system alter configuration ('global.ini', 'SYSTEM') set ('persistence', " \
        "'enable_auto_log_backup') = 'yes' with reconfigure;"
    UNENABLE_LOG_CMD = "alter system alter configuration ('global.ini', 'SYSTEM') set ('persistence', " \
        "'enable_auto_log_backup') = 'no' with reconfigure;"
    LOG_BACKINT_CMD = "alter system alter configuration ('global.ini', 'SYSTEM') " \
        "set ('backup', 'log_backup_using_backint') = 'true';"
    PATH_BLACK_LIST = r"^/$|^/bin$|^/bin/.*|^/boot$|^/boot/.*|^/dev$|^/dev/.*|^/etc$|^/etc/.*|" \
                      r"^/lib$|^/lib/.*|^/lib64$|^/lib64/.*|^/lost+found$|^/lost+found/.*|^/media$|^/media/.*|" \
                      r"^/mnt$|^/proc$|^/proc/.*|^/root$|^/run$|" \
                      r"^/sbin$|^/sbin/.*|^/selinux$|^/selinux/.*|^/srv$|^/srv/.*|^/sys$|^/sys/.*|" \
                      r"^/usr$|^/usr/bin$|^/usr/include$|^/usr/lib$|^/usr/local$|" \
                      r"^/usr/local/bin$|^/usr/local/include$|^/usr/local/sbin$|^/usr/local/share$|" \
                      r"^/usr/sbin$|^/usr/share$|^/usr/src$|^/var$"
